package com.nexen.merchant.warrantyCard.domain;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nexen.common.annotation.Excels;
import com.nexen.common.annotation.Sensitive;
import com.nexen.common.enums.DesensitizedType;
import com.nexen.merchant.barcode.domain.NexenBarcode;
import com.nexen.merchant.member.domain.NexenMember;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.nexen.common.annotation.Excel;
import com.nexen.common.core.domain.BaseEntity;
import com.nexen.common.annotation.Excel.Type;

/**
 * 质保卡对象 nexen_WarrantyCard
 *
 * @author xiao
 * @date 2024-07-31
 */
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NexenWarrantycard extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private Long Id;

    /** 会员ID */
    private Long MemberId;
    @Excels({
            @Excel(name = "姓名", targetAttr = "Name", type = Excel.Type.EXPORT),
            @Excel(name = "手机号", targetAttr = "Mobile", type = Excel.Type.EXPORT),
            @Excel(name = "车牌号", targetAttr = "LicencePlate", type = Excel.Type.EXPORT),
            @Excel(name = "驾驶证", targetAttr = "DriverLicence", type = Excel.Type.EXPORT),
    })
    private NexenMember memberInfo;


    /**
     * 姓名
     */
    private String Name;

    /**
     * 手机号
     */
//    @Sensitive(desensitizedType = DesensitizedType.PHONE)
    private String Mobile;

    /**
     * 车牌号
     */
    private String LicencePlate;

    /**
     * 驾照
     */
    private String DriverLicence;

    /**
     * 质保卡号
     */
    @Excel(name = "质保卡号")
    private String cardNumber;

    /**
     * 门店名称
     */
    @Excel(name = "门店名称")
    private String StoreName;

    /**
     * 省份
     */
    @Excel(name = "省份")
    private String Province;

    private List<String> cityList;

    /**
     * 城市
     */
    @Excel(name = "城市")
    private String City;

    /**
     * 地址
     */
    @Excel(name = "地址")
    private String Address;

    /**
     * 门店负责人
     */
    @Excel(name = "门店负责人")
    private String StoreKeeperName;

    /**
     * 门店负责人联系方式
     */
    @Excel(name = "门店负责人联系方式")
//    @Sensitive(desensitizedType = DesensitizedType.PHONE)
    private String StoreLink;

    /**
     * 购买日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "购买日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date BuyDay;

    /**
     * 发票地址
     */
    //@Excel(name = "购买凭证")
    private String InvoiceImage;


    /**
     * 轮胎照片
     */
    //@Excel(name = "轮胎照片")
    private String TireImage;

    /**
     * openid
     */
    private String OpenId;

    /**
     * 状态: 1:审核中 2:质保中 3:未通过 4:已使用 5:已过期
     */
    @Excel(name = "状态", readConverterExp = "1=待审核,2=质保中,3=未通过,4=已使用,5=已过期")
    private Long Status;

    @Excel(name = "审核人")
    private String auditBy;     // 审核人

    /**
     * 审核意见
     */
    @Excel(name = "审核意见")
    private String StatusMemo;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date Created;

    /**
     * 轮胎条形码1
     */
    @Excel(name = "轮胎条形码1")
    private String TireCode1;
    // 条形码对象
    @Excels({
        @Excel(name = "成品代号", targetAttr = "productCode", type = Type.EXPORT),
        @Excel(name = "SIZE名", targetAttr = "productName", type = Type.EXPORT),
        @Excel(name = "生产日期", targetAttr = "productionDate", type = Type.EXPORT),
        @Excel(name = "目的地", targetAttr = "destination", type = Type.EXPORT),
    })
    private NexenBarcode TireCode1Info;

    /**
     * 轮胎条形码2
     */
    @Excel(name = "轮胎条形码2")
    private String TireCode2;
    // 条形码对象
    @Excels({
            @Excel(name = "成品代号", targetAttr = "productCode", type = Type.EXPORT),
            @Excel(name = "SIZE名", targetAttr = "productName", type = Type.EXPORT),
            @Excel(name = "生产日期", targetAttr = "productionDate", type = Type.EXPORT),
            @Excel(name = "目的地", targetAttr = "destination", type = Type.EXPORT),
    })
    private NexenBarcode TireCode2Info;

    /**
     * 轮胎条形码3
     */
    @Excel(name = "轮胎条形码3")
    private String TireCode3;
    // 条形码对象
    @Excels({
            @Excel(name = "成品代号", targetAttr = "productCode", type = Type.EXPORT),
            @Excel(name = "SIZE名", targetAttr = "productName", type = Type.EXPORT),
            @Excel(name = "生产日期", targetAttr = "productionDate", type = Type.EXPORT),
            @Excel(name = "目的地", targetAttr = "destination", type = Type.EXPORT),
    })
    private NexenBarcode TireCode3Info;

    /**
     * 轮胎条形码4
     */
    @Excel(name = "轮胎条形码4")
    private String TireCode4;
    // 条形码对象
    @Excels({
            @Excel(name = "成品代号", targetAttr = "productCode", type = Type.EXPORT),
            @Excel(name = "SIZE名", targetAttr = "productName", type = Type.EXPORT),
            @Excel(name = "生产日期", targetAttr = "productionDate", type = Type.EXPORT),
            @Excel(name = "目的地", targetAttr = "destination", type = Type.EXPORT),
    })
    private NexenBarcode TireCode4Info;

    /**
     * 是否发送短信标识
     */
    private int sendSms;    // 0:已发送，1:未发送


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("Id", getId())
                .append("Name", getName())
                .append("LicencePlate", getLicencePlate())
                .append("Mobile", getMobile())
                .append("StoreName", getStoreName())
                .append("Province", getProvince())
                .append("City", getCity())
                .append("Address", getAddress())
                .append("StoreKeeperName", getStoreKeeperName())
                .append("StoreLink", getStoreLink())
                .append("BuyDay", getBuyDay())
                .append("InvoiceImage", getInvoiceImage())
                .append("OpenId", getOpenId())
                .append("Status", getStatus())
                .append("StatusMemo", getStatusMemo())
                .append("Created", getCreated())
                .append("DriverLicence", getDriverLicence())
                .append("TireCode1", getTireCode1())
                .append("TireCode2", getTireCode2())
                .append("TireCode3", getTireCode3())
                .append("TireCode4", getTireCode4())
                .append("sendSms", getSendSms())
                .append("TireImage", getTireImage())
                .toString();
    }
}
